package com.catmiao.ai.controller;

import com.catmiao.ai.assistant.Assistant;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/declare")
public class DeclarativeAiServiceController {

    @Resource
    private Assistant chatAssistant;

    @GetMapping("/chat")
    public String chat(@RequestParam(value = "prompt",defaultValue = "介绍一下衡阳") String prompt){
        String chatResult = chatAssistant.chat(prompt);


        return chatResult;
    }
}
